(function(){
	
	Ext.define('AppView.menu.MeunGridModel',{
		extend:'Ext.data.Model',
		fields: [
			{name:'name'},
			{name:'code'},
			{name:'mainClass'}
		]
	});
	
	Ext.define('AppView.menu.MeunGridStore',{
		extend:'Ext.data.Store',
		autoLoad: true,
		model: 'AppView.menu.MeunGridModel',
	    proxy: {
	        type: 'ajax',
	        url: 'app/webMvc/store/menuData.json',
	        reader: {
	            type: 'json',
	            root: 'root'
	        }
	    }
	});
	
	Ext.define('AppView.menu.MeunGrid',{
		extend:'Ext.grid.Panel',
		alias:'widget.meungrid',
		columns: [
	        { text: '名称', dataIndex: 'name', flex: 1},
	        { text: '编码', dataIndex: 'code', flex: 1 },
	        { text: '主类', dataIndex: 'mainClass', flex: 1}
	    ],
	    tbar:[
	    	{
	    		text:'添加',
	    		handler:function(){
	    			var formWin = Ext.create('AppView.menu.MenuWin');
	    			formWin.show();
	    		}
	    	}
	    ],
	    initComponent:function(){
	    	this.store = Ext.create('AppView.menu.MeunGridStore');
	    	this.callParent(arguments);
	    }
	});
})()